package com.cndw.kungfu.model.pvp.war;

import com.cndw.kungfu.config.ConstantsConfig;
import com.cndw.kungfu.domain.Pet;
import com.cndw.kungfu.domain.Player;
import com.cndw.kungfu.model.battle.FighterCrossPet;
import com.cndw.kungfu.model.battle.FighterCrossPlayer;

public class WarFighter {

	private long pid;

	private int sid;

	private FighterCrossPlayer crossPlayer;
	private FighterCrossPet crossPet;

	public WarFighter() {

	}
	
	public WarFighter(Player player){
		pid = player.getPlayerId();
		sid = ConstantsConfig.getSysCgServiceId();
		crossPlayer = new FighterCrossPlayer(player);
		Pet pet = player.getDataInfo().getPet();
		if (pet != null) {
			crossPet = new FighterCrossPet(pet);
		}		
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public int getSid() {
		return sid;
	}

	public void setSid(int sid) {
		this.sid = sid;
	}

	public FighterCrossPlayer getCrossPlayer() {
		return crossPlayer;
	}

	public void setCrossPlayer(FighterCrossPlayer crossPlayer) {
		this.crossPlayer = crossPlayer;
	}

	public FighterCrossPet getCrossPet() {
		return crossPet;
	}

	public void setCrossPet(FighterCrossPet crossPet) {
		this.crossPet = crossPet;
	}
	
	public int getScore(){
		return crossPlayer.getScoreCHK();
	}
	
	public int getLevel(){
		return crossPlayer.getLevel();
	}

	
	public void fullHpAndMp(){
		crossPlayer.setHp(crossPlayer.getMaxHp());
		crossPlayer.setMp(crossPlayer.getMaxMp());
		crossPlayer.resetSkillId();
		if (crossPet != null) {
			crossPet.setHp(crossPet.getMaxHp());
			crossPet.setMp(crossPet.getMaxMp());
		}
	}
}
